home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #22 (1994-01-19)(Diesel)(DE)[WB].zip / Purity #22 (1994-01-19)(Diesel)(DE)[WB].adf / ForuM / PrtChk.p < prev   
Text File  |  1993-11-22  |  1KB  |  49 lines

  1. program DruckerAbfrage;
  2.  
  3. { ************************************************************
  4.  
  5.   Ich weiß nicht mehr, wer danach gefragt hat, aber ich denke,
  6.   das hier interessiert auch andere:
  7.  
  8.   Druckerabfrage, direkt über die CIA. Nicht ganz via System,
  9.   sollte aber auf allen Amigas ohne Probleme (!) laufen.   ;)
  10.  
  11.   Das Programm fragt das Register $BFD000 im CIA-B ab, in
  12.   welchem die folgenden Bits interesant sind:
  13.  
  14.     7 6 5 4 3 2 1 0
  15.     - - - - - - x x
  16.               ^----  Busy
  17.             ^------  PaperOut
  18.  
  19.  
  20.                                        (P) 13.09.1993, Diesel
  21.  
  22.   ************************************************************ }
  23.  
  24. Const
  25.     PRA = $BFD000;  { * Basis-Addresse CIA-B * }
  26.  
  27. Type
  28.     BytePtr = ^Byte;
  29.  
  30. Var
  31.     CIA_Byte : BytePtr;
  32.  
  33.     CIA_Data : Byte;
  34.  
  35.  
  36. Begin
  37.     CIA_Byte := Address(PRA);
  38.     CIA_Data := ( CIA_Byte^ ) MOD 4 ;
  39.     { * denn nur die leztzen zwei Bits sind wichtig ! * }
  40.  
  41.     Case CIA_Data of
  42.      3 : Writeln("Der Drucker ist\n- entweder aus\n- oder offline und hat kein Papier mehr.");
  43.      1 : Writeln("Der Drucker ist offline.");
  44.      2 : Writeln("Der Drucker hat kein Papier mehr.");
  45.      0 : Writeln("Der Drucker ist online.");
  46.     End;
  47. End.
  48.  
  49.